import request from '@/utils/request.ts'

interface Response {
  code: number
  message: string
  data: any
}

// 日内动量策略回测
// POST /backtest/IntradayMovementStrategy
// 接口ID：327437294
// 接口地址：https://app.apifox.com/link/project/5539657/apis/api-327437294
export const post_IntradayMovementStrategy = async (paramObj: Record<string, string>): Promise<Response> => {
  const params = new URLSearchParams()
  // 参数列表
  const params_list = ['code', 'window', 'start_date', 'end_date', 'cash', 'commission', 'hands', 'period']
  for (const key in paramObj) {
    if (params_list.includes(key)) {
      params.append(key, paramObj[key])
    }
  }

  return request.post('/backtest/IntradayMovementStrategy', params)
}
